﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="AddContact.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.Client.AddContact" %>

<%--Title--%>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>

<%--Content--%>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <fieldset>
        <legend>Ajouter un nouveau contact : </legend>
                <table>
                    <tr>
                        <asp:ValidationSummary ID="addContactSummary" runat="server"
                        headerText="Il y a des erreurs sur la page :" />
                    </tr>
                    <tr>
                        <td>Nom : </td>
                        <td>
                            <asp:TextBox ID="addContactLastName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="lastNameRequired" runat="server"
                            ControlToValidate="addContactLastName"
                            ErrorMessage="Le nom est requis"> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Prénom : </td>
                        <td>
                            <asp:TextBox ID="addContactFirstName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="firstNameRequired" runat="server"
                            ControlToValidate="addContactFirstName"
                            ErrorMessage="Le prénom est requis"> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Téléphone : </td>
                        <td>
                            <asp:TextBox ID="addContactPhone" runat="server" />
                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="phoneRequired" runat="server"
                            ControlToValidate="addContactPhone"
                            ErrorMessage="Le numéro de téléphone est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Adresse Mail : </td>
                        <td>
                            <asp:TextBox ID="addContactEmail" runat="server" Width="300" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="emailRequired" runat="server"
                            ControlToValidate="addContactEmail"
                            ErrorMessage="L'adresse mail est requise"> *
                            </asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="emailValidated" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="addContactEmail" ErrorMessage="Format d'e-mail invalide."></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Fonction : </td>
                        <td>
                            <asp:TextBox ID="addContactFunction" runat="server" Width="300" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="functionRequired" runat="server"
                            ControlToValidate="addContactFunction"
                            ErrorMessage="La fonction est requise."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Client :
                        </td>
                        <td>
                            <asp:Label ID="addContactClient" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="addContactButton" runat="server" Text="Ajouter un contact" OnClick="addContactButton_Click"/></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="addContactErrorMessage"  runat="server" />
                        </td>
                    </tr>
                </table>
    </fieldset>
</asp:Content>

<%--Footer--%>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>